<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="lib/react.development.js"></script>
    <script src="lib/react-dom.development.js"></script>
    <script src="lib/babel.min.js"></script>
</head>
<body>
    <div id="root"></div>
    <script type="text/babel">
    let {Component} = React

    class Parent extends Component{
        render(){

            return(
                <div>
                    <h2>这个是父组件</h2>
                    <Child title="这是子组件的title">
                        <List arr={['aaaaaa','bbbbbbbb','cccccccc','ddddddddddd']} />
                    </Child>
                </div>
            )
        }
    }

    const List = ({arr})=><ul>
                            {
                                arr.map((item,index)=>
                                    <li key={index}>{item}</li>
                                )
                            }
                        </ul>

    class Child extends Component{
        render(){

            console.log(this.props)
            let { title, children } = this.props;


            return(
                <div>
                    <p>这里是子组件</p>
                    <p>{title}</p>
                    {children}
                </div>
            )
        }
    }





    ReactDOM.render(
        <Parent />,
        document.querySelector("#root")
    )

    </script>
</body>
</html>